function [rmse] = calc_rmse(U,V, data)
    rating  = data(:,3);
    u_ind   = data(:,1);
    m_ind   = data(:,2);
    
    pred_out = sum(U(:,u_ind).*V(:,m_ind),1)';
    rmse = sqrt(mean((pred_out-rating).^2));
   